package com.huang.untils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReCode implements Serializable {

    private Integer errorCode=0;
    private String message="";
    private Map<Object,Object> data=new HashMap<>();

    public ReCode isOK (){
        errorCode=0;
        message="";
        return this;
    }

    public ReCode put(List sd){
        data.put("count",sd.size());
        data.put("products",sd);
        return this;
    }
}
